﻿
(function($) {
    
	window["load_BingMapsSample_ucSearchForm"] = function(obj) {

        // Event Handlers.
        $(".search_options h4").click(function(event) {
            var self = $(this);
            
            if (self.hasClass("minimized"))
            {
                self.removeClass("minimized").addClass("maximized");
                self.parent().find(".address_form").slideDown();
            }
            else if (self.hasClass("maximized"))
            {
                self.parent().find(".address_form").slideUp(function() {
                    self.removeClass("maximized").addClass("minimized");
                });
            }
        });  
        
        
        $("input[id$='txtKeyword']").keydown(function(event) {
            if (event.which == 13) 
            {
                event.preventDefault();
                event.stopPropagation();
                
                $("input[id$='btnSearch']").click();
            }
        });


		alert(obj.btnSearch());
        
    };
})(jQuery.noConflict());